package com.kfc.platform.user.service.impl;


import java.util.ArrayList;
import java.util.List;

import com.kfc.platform.user.dao.StudentDao;
import com.kfc.platform.user.dao.TeacherDao;
import com.kfc.platform.user.dao.UserDao;
import com.kfc.platform.user.domain.Student;
import com.kfc.platform.user.domain.Teacher;
import com.kfc.platform.user.domain.User;
import com.kfc.platform.user.service.StudentService;
import com.kfc.platform.user.service.TeacherService;
import com.kfc.platform.user.service.UserService;

public class StudentServiceImpl implements StudentService{
	private StudentDao studentDao;

	@Override
	public String createStudent(Student student) {
		// TODO Auto-generated method stub
		Student insert = new Student();
		insert.setName(student.getName());
		insert.setClassnum(student.getClassnum());
		studentDao.save(insert);
		return "插入数据库成功！";
	}

	public StudentDao getStudentDao() {
		return studentDao;
	}

	public void setStudentDao(StudentDao studentDao) {
		this.studentDao = studentDao;
	}

	@Override
	public void deleteStudent(Student student) {
		// TODO Auto-generated method stub
	}

	@Override
	public List<Student> findStudentAll(Student student) {
		// TODO Auto-generated method stub
		List<Student> list = new ArrayList<Student>();
		list = studentDao.findAll();
		return list;
	}

	@Override
	public List<Student> findStudentByName(String name) {
		// TODO Auto-generated method stub
		List<Student> list = new ArrayList<Student>();
		list = studentDao.findByName(name);
		return list;
	}

	@Override
	public List<Object[]> findSthById(int id) {
		// TODO Auto-generated method stub
		List<Object[]> ls = studentDao.findSthById(id);
		return ls;
	}
}
